<?php

namespace fastphp;

use fastphp\util\Header;

class Response
{
    public function create($msg, $data = [], $code = 200)
    {
        Header::setJsonHeader();
        echo json_encode([
            'code' => $code,
            'msg' => $msg,
            'data' => $data,
        ],true);
    }
}